package com.lagou.rpc.consumer.conf;

import com.lagou.rpc.api.IUserService;
import com.lagou.rpc.consumer.proxy.RpcClientProxy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Component
public class RpcConfig {

    @Autowired
    private RpcClientProxy rpcClientProxy;

    @Bean
    public IUserService getUserService() {
        return (IUserService) rpcClientProxy.createProxy(IUserService.class);
    }

}
